<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:body>
        <ui:composition template="./../template/main.xhtml">
            <ui:define name="content">
                <h1 class="title ui-widget-header ui-corner-all ">Quản Lý Đánh Giá</h1>
                <p:growl id="messages"/>
                <p:outputPanel deferred="true">
                
                <h:form id="formDataTable">
                    <p:dataTable style="text-align: center" id="phonevoteform" var="phonevote" value="#{phoneVoteController.listphonevote}" paginator="true" rows="10" 
                                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" rowsPerPageTemplate="5,10,15" 
                                 emptyMessage="Không tìm thấy ...">   
                        <p:column headerText="Tên điện thoại" style="width:5%; text-align: center" sortBy="#{phonevote.phone.name}" filterBy="#{phonevote.phone.name}">
                            <h:outputText value="#{phonevote.phone.name}" />
                        </p:column>
                        <p:column headerText="Thiết kế" style="width:25%; text-align: center" sortBy="#{phonevote.design}" filterBy="#{phonevote.design}">
                            <h:outputText value="#{phonevote.design}" />
                        </p:column>
                        <p:column headerText="Hiệu suất" style="width:25%; text-align: center" sortBy="#{phonevote.performance}" filterBy="#{phonevote.performance}">
                            <h:outputText value="#{phonevote.performance}" />
                        </p:column>
                        <p:column headerText="Màn hình" style="width:25%; text-align: center" sortBy="#{phonevote.screen}" filterBy="#{phonevote.screen}">
                            <h:outputText value="#{phonevote.screen}" />
                        </p:column>
                        <p:column headerText="Điểm trung bình" style="width:25%; text-align: center" sortBy="#{phonevote.avg}" filterBy="#{phonevote.avg}">
                            <h:outputText value="#{phonevote.avg}" />
                        </p:column>
                        <p:column headerText="Tổng số đánh giá" style="width:25%; text-align: center" sortBy="#{phonevote.totalUserVote}" filterBy="#{phonevote.totalUserVote}">
                            <h:outputText value="#{phonevote.totalUserVote}" />
                        </p:column>
                      </p:dataTable>  
                    
                </h:form>
            </p:outputPanel>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
